function [scheduledTargets, scheduledPriorities, status] = GRASP_FindMatchingSolution(s1ScheduledTargets, s1ScheduledPriorities, s2ScheduledTargets, s2ScheduledPriorities) %#ok<INUSD>
%GRASP_FindMatchingSolution Summary of this function goes here
%   Detailed explanation goes here

status = 0;
scheduledTargets = [];
scheduledPriorities = [];

for n = 1:size(s1ScheduledTargets, 1)
  for m = 1:size(s2ScheduledTargets, 1)
    if size(s1ScheduledTargets(n, :), 2) == size(s2ScheduledTargets(m, :), 2)
%       equal = 1;
%       for k = 1:size(s1ScheduledTargets, 2)
%         if s1ScheduledTargets(n, k) ~= s2ScheduledTargets(m, k)
%           equal = 0;
%           break;
%         end
%       end
      equal = all(s1ScheduledTargets(n, :) == s2ScheduledTargets(m, :));
      if equal
        scheduledTargets = s1ScheduledTargets(n, :);
        scheduledPriorities = s1ScheduledPriorities(n, :);
        status = 1;
      end
    end
  end
end
end % function